﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VanBanNhaDat.aspx.cs" Inherits="WebHousingInfo.VanBanNhaDat" %>
<%@ Register Src="~/Controls/Header.ascx" TagName="Head" TagPrefix="Header" %>
<%@ Register Src="~/Controls/MenuFooter.ascx" TagName="MeNuDuoi" TagPrefix="MenuFooter" %>
<%@ Register Src="~/Controls/Footer.ascx" TagName="Foot" TagPrefix="Footer" %>
<%@ Register Src="~/Controls/Quangcaotraitrangcon.ascx" TagName="QC" TagPrefix="Quangcaotraitrangcon" %>
<%@ Register Src="~/Controls/TimKiemTrangCon.ascx" TagName="TK" TagPrefix="TimKiemTrangCon" %>
<%@ Register Src="~/Controls/NhaDatBanThueMoiTrangCon.ascx" TagName="NDM" TagPrefix="NhaDatBanThueMoiTrangCon" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Trang Văn Bản Nhà Đất</title>
</head>
<body>
    <form id="form1" runat="server">
        <div id="uni_wrapper">
            <Header:Head ID="Header" runat="server" />
	        <div id="uni_main">
		        <div id="content" class="clearfix">
			        <div id="group_240_l">
			        <!--b box search-->
                        <TimKiemTrangCon:TK ID="TimKiemTrangCon" runat="server" />					     	
				        <NhaDatBanThueMoiTrangCon:NDM ID="NhaDatBanThueMoiTrangCon" runat="server" />
                        <Quangcaotraitrangcon:QC ID="Quangcaotraitrangcon" runat="server" />
                        
			        </div>
			        <div id="group_710_r">
				        <div id="thongtin">
					        <div class="title">
						        <div class="doc730 fright">
                                  <div id="boxdoc01" class="boxt01 w730">
                                    <div class="doctt">
                                      <div class="topc">
                                        <div class="docmenu fleft">
                                          <ul class="mnu">
                                            <li class="item"><a href="VanBanNhaDat.aspx?xem=tatca"><span>Tất cả</span></a></li>
                                            <li class="item"><a href="VanBanNhaDat.aspx?xem=moinhat"><span>Mới nhất</span></a></li>
                                            <li class="item"><a href="VanBanNhaDat.aspx?xem=xemnhieu"><span>Xem nhiều</span></a></li>
                                            <li class="item"><a href="VanBanNhaDat.aspx?xem=download"><span>Download nhiều</span></a></li>  
                                            <li class="item"><a onclick="show_form_vanban();" style="cursor:pointer;"><span>Upload văn bản</span></a></li>                                                                                      
                                          </ul>
                                        </div>
                                        <div class="fright">                                                                                    
                                          <asp:TextBox ID="txtsearch_book" style="padding-top:7px;" runat="server"></asp:TextBox>
                                          <asp:ImageButton class="btn40x19" style="margin-top:4px;" Height="20px" 
                                                ID="ImageButton1" runat="server" ImageUrl="Image/btn40x19_edit.gif" 
                                                onclick="ImageButton1_Click" />
                                        </div>
                                      </div>
                                    </div>
                                    <div class="boxcont">
		                              <div class="job">
		                              </div>
		                            <ul class="listdoc02">
		                            <% var obText = getdatasource();
                                        int view = 0;
                                        foreach (var detail in obText)
                                        {
                                            view += 1; %>
		  			                    <li>
                                          <div class="fleft">
                                            <div class="sd">
                                              <p>
                                                <a href="ChiTietVanBan.aspx?masach=<%=detail.TextHouseID %>" title="Sach">
					                                <strong class="vipdoc">&nbsp;</strong>	
					                                <% if (view % 2 != 0)
                                                    { %>				
    					                                <img height="60px" width="60px" alt="Sach" src="Image/book2.jpg" />
					                                <%} else { %>
					                                    <img height="60px" width="60px" alt="Sach" src="Image/book1.jpeg" />
					                                <%} %>
					                            </a> 
					                          </p>
                                            </div>
                                            <div class="context">
                                              <p class="r1"><a class="fbold" href="ChiTietVanBan.aspx?masach=<%=detail.TextHouseID %>" title="Ten Sach"><%=detail.Title %></a></p>
                                              <p class="fs11 cgray pb_5">
                                                <% if (getextension(detail.UrlDownload) == 1)
                                                   { %>
					                                <img alt="doc" src="Image/doc.gif">
					                            <% }
                                                   else if (getextension(detail.UrlDownload) == 2)
                                                   { %>
					                                <img alt="pdf" src="Image/pdf16x16.gif">
					                            <% }%>
					                            &nbsp; Người đăng :<span class="cred"> <%=detail.UserName %></span>
					                            <span class="plr_5">|</span>&nbsp; Ngày đăng :<span class="cred"><%=Convert.ToDateTime(detail.CreatedDate).ToShortDateString() %></span>
					                            <span class="plr_5">|</span>&nbsp;Lượt xem: <span class="cred"><%=detail.ViewCount %></span>
					                            <span class="plr_5">|</span>&nbsp;Download:<span class="cred"><%=detail.DownloadCount %></span></p>
                                            </div>
                                          </div>
                                          <div class="fright">
                                            <p><img align="absmiddle" src="../Image/ico_15x15_1.gif">
					                            <a onclick="show_form_vanban();" style="cursor:pointer;">Upload văn bản</a></p>
                                            <p class="end"><img align="absmiddle" src="../Image/ico_15x15_3.gif">
					                            <a href="TotalUpload/VanBan/<%=detail.UrlDownload %>">Download văn bản</a>
					                            </p>
                                          </div>
                                         </li>  
                                         <%} %>
                                       
			 		                  </ul>
			 		                  <% if(obText != null && obText.Count > 0) { %>
                                      <div id="link">
		                                    <asp:Label ID="lblpaging" runat="server" Text=""></asp:Label>
	                                  </div>
	                                  <%} %>
		                            </div>
                                    <div class="botc">
                                      <p>&nbsp;</p>
                                    </div>
                                  </div>
                            </div> 
					        </div>
					        <div id="content_data">
					        </div>
				        <!--e subtitle-->
				        </div>
			        </div>
		        </div>  
		        <div id="formvanban" style="display:none;">
		            <div class="loadervanban" style="border: 1px solid blue; width:320px;">
		                <div style="background:yellow; font-weight:bold; padding:5px;">Upload văn bản mới</div>
		                <div style="border-top:1px solid red; padding:5px; background:#E1E1E1;">
		                    <div style="margin-bottom:5px;">
		                        <p style="width:100px; font-weight:bold; color:Blue; float:left; margin-right:10px;">Tên file văn bản</p>		                
                                <asp:TextBox ID="txtten" Width="180px" runat="server"></asp:TextBox>
                            </div>
                            <div>
		                        <p style="width:100px; font-weight:bold; color:Blue; float:left; margin-right:10px;">Chọn file văn bản</p>		                
                                <asp:FileUpload ID="FileUpload_VanBan" Width="180px" runat="server" /><br />                            
                            </div>
                            Lưu ý chỉ cho phép upload các định dạng .doc, .pdf
                            <div style="margin-top:5px;">                            
                                <asp:LinkButton ID="lbtupload" runat="server" onclick="lbtupload_Click">Upload</asp:LinkButton>  
                                <a onclick="hide_form_vanban();" style="cursor:pointer; margin-left:5px;">Huỷ</a>
                            </div>
		                </div>
		            </div>		            
		        </div>	
		        <script type="text/javascript">
                function show_form_vanban(){
                $('#formvanban').show();
                }
                function hide_form_vanban(){
                $('#formvanban').hide();
                }

                $('#formvanban').hide();

                </script>
		        <MenuFooter:MeNuDuoi ID="MenuFooter" runat="server" />	
	        </div>
	        <Footer:Foot ID="Footer" runat="server" />
        </div>    
    </form>
</body>
</html>
